const action = require("../action");

module.exports = {
    "GET /studio/:studioId": async (ctx, next) => {
        let studioId = ctx.params.studioId;
        let studioData = await action.studio.getStudioPageData(studioId);
        
        ctx.render("studio.html", {
            "ui": {
                "studioTab": {
                    "state": "MAIN",
                    "url": {
                        "main": "/studio/"+ studioId +"/",
                        "service": "/studio/" + studioId + "/service-list"
                    }
                },
                "title": studioData.title,
                "env": process.env.NODE_ENV,
                "studioBanner": studioData.studioBanner,
            },
            "studioSliderPhotos": studioData.studioSliderPhotos,
            "studioContent": studioData.studioContent
        });
        // ctx.render('studio.html', {
        //     "ui": {
        //         "tab": "main"
        //     },
        //     "data": {
        //         "title": studioData.title,
        //         "studioBanner": studioData.studioBanner,
        //         "studioSliderPhotos": studioData.studioSliderPhotos,
        //         "studioContent": studioData.studioContent
        //     }
        // });

    }
};

